package io.finer.erp.jeecg.stock.service;

import io.finer.erp.jeecg.stock.entity.PurchaseOrderEntry;
import io.finer.erp.jeecg.stock.vo.PurchaseOrderPage;
import io.finer.erp.jeecg.stock.vo.SupplierPriceVO;
import io.finer.erp.jeecg.finance.vo.PurchaseOrderVO;
import io.finer.erp.jeecg.stock.entity.PurchaseOrder;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.jeecg.common.api.vo.Result;

/**
 * @Description: 出入库单
 * @Author: jeecg-boot
 * @Date:   2021-05-20
 * @Version: V1.0
 */
public interface IPurchaseOrderService extends IService<PurchaseOrder> {

	/**
	 * 添加一对多
	 * 
	 */
	public void saveMain(PurchaseOrder purchaseOrder,List<PurchaseOrderEntry> purchaseOrderEntryList) ;
	
	/**
	 * 修改一对多
	 * 
	 */
	public void updateMain(PurchaseOrder purchaseOrder,List<PurchaseOrderEntry> purchaseOrderEntryList);
	
	/**
	 * 删除一对多
	 */
	public void delMain (String id);
	
	/**
	 * 批量删除一对多
	 */
	public void delBatchMain (Collection<? extends Serializable> idList);

	/**
	 * @Description 获取供应商的该物料的价格
	 * @param supplierId 供应商ID
	 * @param categoryId 物料分类ID
	 * @return
	 * Create at: 2021-06-10 12:01:28
	 * @author: duany
	 * Revision:
	 *    2021-06-10 12:01:28 - first revision by duany
	 *        
	 */
	public Result<SupplierPriceVO> getSupplierPrice(String supplierId, String categoryId);

	/**
	 * @Description 采购单审核
	 * @param id
	 * Create at: 2021-06-11 14:21:32
	 * @author: duany
	 * Revision:
	 *    2021-06-11 14:21:32 - first revision by duany
	 *        
	 */
	public boolean approve(PurchaseOrderPage order);

	/**
	 * @Description 列表查询功能
	 * @param page
	 * @param req
	 * @return
	 * Create at: 2021-06-12 15:27:47
	 * @author: duany
	 * Revision:
	 *    2021-06-12 15:27:47 - first revision by duany
	 *        
	 */
	public IPage<PurchaseOrderVO> getPurchaseOrderList(Page<PurchaseOrderVO> page, HttpServletRequest req);
	
	
	public List<PurchaseOrderVO> getPurchaseOrderList(HttpServletRequest req);
	
}
